package com.njwb.reflect;

/**
 * Description: 类的描述
 * Author: yuandeyin@itany.com
 * Date: 2025-08-07 11:50
 * Version: 1.0
 */
public class TestClassInfo {
    public static void main(String[] args) {
        Person person = new Person();
        Class personClass = person.getClass();
        System.out.println(personClass.getName());//com.njwb.reflect.Person
        System.out.println(personClass.getName().substring(personClass.getName().lastIndexOf(".") + 1));//Person
        System.out.println(personClass.getSimpleName());//Person

        Package pk = personClass.getPackage();
        System.out.println(pk.getName());//com.njwb.reflect

    }
}
